package com.evil.common.account.dto;

import com.evil.common.family.dto.FindByStringsReqDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Collection;

/**
 * @author liyang
 * @date 2023-02-16 14:54
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FindByNamesAndEIdReqDTO extends FindByStringsReqDTO {

    /**
     * 企业ID
     */
    private Long enterpriseId;

    public FindByNamesAndEIdReqDTO(Collection<String> strings, Boolean filterDeleted, Boolean cache, Long enterpriseId) {
        super(strings, filterDeleted, cache);
        this.enterpriseId = enterpriseId;
    }

    public static FindByNamesAndEIdReqDTO filter(Long enterpriseId, Collection<String> strings) {
        return new FindByNamesAndEIdReqDTO(strings, true, false, enterpriseId);
    }

    public static FindByNamesAndEIdReqDTO unFilter(Long enterpriseId, Collection<String> strings) {
        return new FindByNamesAndEIdReqDTO(strings, false, false, enterpriseId);
    }

    public static FindByNamesAndEIdReqDTO filterCache(Long enterpriseId, Collection<String> strings) {
        return new FindByNamesAndEIdReqDTO(strings, true, true, enterpriseId);
    }

    public static FindByNamesAndEIdReqDTO unFilterCache(Long enterpriseId, Collection<String> strings) {
        return new FindByNamesAndEIdReqDTO(strings, false, true, enterpriseId);
    }
}
